using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Portal.BO.Editoral.LogNews;

namespace Portal.GUI.EditoralOffice.MainOffce.LogNewDetail
{
    public partial class LogNewsDetail : System.Web.UI.UserControl
    {
        protected String News_Title = String.Empty;
        protected String News_Subtitle = String.Empty;
        protected String News_Image = String.Empty;
        protected String News_ImageNote = String.Empty;
        protected String News_Content = String.Empty;
        protected String News_Author = String.Empty;
        protected String News_Status = String.Empty;
        protected String News_SwitchTime = String.Empty;
        protected String News_PublishDate = String.Empty;
        protected String News_VIewNum = String.Empty;
        protected String News_CreateDate = String.Empty;
        protected String News_ModifiedDate = String.Empty;        
        protected String Log_CreatedDate = String.Empty;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                String strLog_News_ID = Request.QueryString["LogNewsID"];
                LogHelper logHelper = new LogHelper();
                DataTable table = logHelper.SelectOneLogNews(Convert.ToInt64(strLog_News_ID));
                if (table.Rows.Count != 0)
                {
                    News_Title = table.Rows[0]["News_Title"].ToString();
                    News_Subtitle = table.Rows[0]["News_Subtitle"].ToString();
                    News_Image = table.Rows[0]["News_Image"].ToString();
                    imgNews.ImageUrl = "/" + News_Image;
                    News_ImageNote = table.Rows[0]["News_ImageNote"].ToString();
                    News_Content = table.Rows[0]["News_Content"].ToString();
                    News_Author = table.Rows[0]["News_Author"].ToString();
                    News_Status = table.Rows[0]["News_Status"].ToString();

                    if (!(table.Rows[0]["News_SwitchTime"] == null || table.Rows[0]["News_SwitchTime"].ToString().Equals(String.Empty)))
                    {
                        News_SwitchTime = ((DateTime)table.Rows[0]["News_SwitchTime"]).ToString("dd/MM/yyyy hh:mm:ss tt");
                    }
                    if (!(table.Rows[0]["News_PublishDate"] == null || table.Rows[0]["News_PublishDate"].ToString().Equals(String.Empty)))
                    {
                        News_PublishDate = ((DateTime)table.Rows[0]["News_PublishDate"]).ToString("dd/MM/yyyy hh:mm:ss tt");
                    }
                    
                    News_VIewNum = table.Rows[0]["News_VIewNum"].ToString();
                    
                    if (!(table.Rows[0]["News_CreateDate"] == null || table.Rows[0]["News_CreateDate"].ToString().Equals(String.Empty)))
                    {
                        News_CreateDate = ((DateTime)table.Rows[0]["News_CreateDate"]).ToString("dd/MM/yyyy hh:mm:ss tt");
                    }                    
                    if (!(table.Rows[0]["News_ModifiedDate"] == null || table.Rows[0]["News_ModifiedDate"].ToString().Equals(String.Empty)))
                    {
                        News_ModifiedDate = ((DateTime)table.Rows[0]["News_ModifiedDate"]).ToString("dd/MM/yyyy hh:mm:ss tt");
                    }
                    if (!(table.Rows[0]["Log_CreatedDate"] == null || table.Rows[0]["Log_CreatedDate"].ToString().Equals(String.Empty)))
                    {
                        Log_CreatedDate = ((DateTime)table.Rows[0]["Log_CreatedDate"]).ToString("dd/MM/yyyy hh:mm:ss tt");
                    }                    
                }
            }
        }
    }
}